/**
 * 
 */
package org.cuatrovientos.bill;

import java.util.Scanner;
import java.util.Vector;

/**
 * @author Axel
 */
public class Bill {
	
	Vector<Product> products;
	
	/**
	 * Adds new product to products vector.
	 * Product properties are determined by the user.
	 */
	public void addProduct(String name, float price, int quantity){
	
		Product product = new Product(name, price, quantity);
		products.add(product);
		
	}
	
	/**
	 * Returns the total cost of the stored products in vector products.
	 * @return
	 */
	public float totalBill(){
		float total = 0f;
		for (Product product : products)
			total += product.totalPrice();
		return total;
	}
	
	/**
	 * Returns the total bill cost plus a 21% more.
	 * @return
	 */
	public float totalIVA(){
		return totalBill() * 1.21f;
	}

}
